/******************************************************************************
 * @File name   :      MaintainActivateController.java
 *
 * @Author      :      ANMA
 *
 * @Date        :      Jul 31, 2015
 *
 * @Copyright Notice: 
 * Copyright (c) 2014 DMS, Inc. All  Rights Reserved.
 * This software is published under the terms of the DMS Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * ----------------------------------------------------------------------------
 * Date                         Who         Version         Comments
 * Jul 31, 2015 2:06:59 PM    ANMA      1.0            Initial Version
 *****************************************************************************/
package com.cap.bts.crmdp.dealer.mars.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cap.bts.crmdp.dealer.mars.domain.MarsConfig;
import com.cap.bts.crmdp.dealer.mars.service.IMarsConfigService;
import com.cap.bts.framework.common.controller.BaseController;

/**
 * 
 */
@Controller
public class MarsConfigController extends BaseController {
	//private static final  Logger LOGGER  = Logger.getLogger(MarsConfigController.class)
	
	@Autowired
	IMarsConfigService marsConfigService;

	@RequestMapping(value = "/marsConfig")
	public String singlePageMARS(Model model) {
		MarsConfig config = marsConfigService.get();
		
		model.addAttribute("config", config);
		
		return "mars/config";
	}
	
	
	@RequestMapping(value = "/marsConfig/save")
	@ResponseBody
	public Object saveConfig(MarsConfig config) {
		config.setId(1L);
		marsConfigService.save(config);
		Map map = new HashMap();
		
		map.put("success", true);
		
		return map;
	}
	
	
}
